<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>查看订单 - {$site_name}</title>
	<meta name="keywords" content="{$site_seo_keywords}" />
	<meta name="description" content="{$site_seo_description}">
	<tc_include file="Public:head" />	
</head>

<body class="body-white" id="top">
	<!---头部开始--->
	<tc_include file="Public:header"/>
	<!---头部结束--->

		<div class="k-row user-center-main">
                <div class="row">
                    <div class="c-left fl">
	                    <tc_include file="Public:usernav"/>
                    </div>
                    <div class="c-right fr o-detail">
                        <div class="d-top">
							<div class="left fl">
								<p class="o-sn">订单号：{$order.order_sn}</p>
								<if condition="($order.pay_status eq 0)  AND ($order.order_status neq 4)">
								<a href="{:U('Goods/cart/topay',array('order_id'=>$order['order_id']))}" class="btn btn-on">付款</a>
								<elseif condition="($order.shipping_status eq 0) AND ($order.order_status neq 4)" />
								<p class="o-p">未发货</p>
								<elseif condition="($order.shipping_status eq 1)  AND ($order.order_status neq 4)" />								
								<a href="javascript:;" class="btn btn-on" onclick="layerPrompt('{$order['order_id']}','receive')">确定收货</a>
								<elseif condition="($order.shipping_status eq 2) AND ($order.order_status eq 1)" />
								<a href="{:U('Comment/GoodsComment/index',array('order_id'=>$order['order_id']))}" class="btn btn-on">评价</a>
								<elseif condition="$order.order_status eq 2" />
								<span class="fh">已完成</span>
								<elseif condition="$order.order_status eq 4" />
								<span class="xh">已取消</span>
								</if>
								<if condition="($order.pay_status eq 0) AND ($order.order_status neq 4)">
								<a href="javascript:;" class="k-a" onclick="layerPrompt('{$order['order_id']}','invalid')">取消订单</a>
								</if>
							</div>
							<div class="right fl">
								<p>收货人：{$order.consignee}</p>
								<p>联系电话：{$order.mobile}</p>
								<p>收货地址：{$order.address_info}{$order.address}</p>
								<p>商品合计：<span class="xh">￥{$order.order_amount}</span></p>
							</div>
						</div>
						<div class="d-log">
							<div class="left fl">
								<p>订单处理信息</p>
								<p>配送物流：<if condition="$order.shipping_name eq ''">未发货<else />{$order.shipping_name}</if></p>
								<p>快递单号：<if condition="$order.delivery_no eq ''">未发货<else />{$order.delivery_no}</if></p>
							</div>
							<div class="right fl">
								<foreach name="order_log" item="vo">
								<p><i class="fa fa-dot-circle-o"></i><span>{$vo.log_time|date="Y-m-d H:i:s",###}</span>{$vo.action_note}</p>
								</foreach>								
							</div>
							<div class="clear"></div>
						</div>
						<div class="d-goods c-order">
							<table>
								<tr class="tr-hd">
									<td align="center">商品</td>
									<td width=100 align="center">数量</td>
									<td width=150 align="center">单价</td>
									<td width=150 align="center">应付</td>
								</tr>
								<foreach name="order_goods" item="val">
								<tr class="tr-bd">
									<td>
										<div class="goods-item">
											<a href="{:U('Goods/article/index',array('g_id'=>$val['goods_id']))}" target="_blank"><img class="g-img fl" src="{:sp_get_asset_upload_path($val['goods_img'])}" alt="" />
											<div class="t-goods fl"></a>
												<a title="{$val.goods_name}" href="{:U('Goods/article/index',array('g_id'=>$val['goods_id']))}" target="_blank">{$val.goods_name|msubstr=0,15,'utf-8','...'}</a><br />
												<span>{$val.spec_item_name}</span>
											</div>															
															
										</div>
									</td>
									<td align="center">{$val.goods_num}</td>
									<td align="center">{$val.member_goods_price}</td>
									<td align="center">{$val.goods_total}</td>
								</tr>
								</foreach>
							</table>
						</div>
                    </div>
                </div>

		

	</div>
	<!-- /container -->
	<tc_include file="Public:footer" />
	<tc_include file="Public:scripts" />
	<script type="text/javascript">
	$(function(){
		$(".nav-tabs li:first").addClass('active');
		 $(".nav-tabs li").click(function(){
			 $(this).addClass("active").siblings().removeClass("active"); 
			 var index=$(this).index(); 
			 $(".tab-content > .tab-pane").eq(index).show().siblings().hide(); 
		 });
	});
	</script>	
	<script type="text/javascript">
	function layerPrompt(id,type){		
		layer.confirm('确定要进行此操作吗？', {
		  btn: ['确定','取消'] //按钮
		}, function(){
			operate(id,type);
			layer.closeAll('page');
			layer.msg(null);
		}, function(){
		  
		});
	}
	</script>
	<script type="text/javascript">
		function operate(id,type){
			$.ajax({
				url:"/index.php?g=User&m=profile&a=operate&type="+type+"&id="+id,
				success: function(data){					
					parent.location.reload();
				}
			});	
		}
	</script>
</body>
</html>